﻿/*******************************************************************************
 * Copyright (c) 2010-2011 Robert Fraser                                       *
 *                                                                             *
 * Permission is hereby granted, free of charge, to any person obtaining a     *
 * copy of this software and associated documentation files (the "Software"),  *
 * to deal in the Software without restriction, including without limitation   *
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,    *
 * and/or sell copies of the Software, and to permit persons to whom the       *
 * Software is furnished to do so, subject to the following conditions:        *
 *                                                                             *
 *   - The above copyright notice and this permission notice shall be included *
 *     in all copies or substantial portions of the Software.                  *
 *                                                                             *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  *
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,    *
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      *
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING     *
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER         *
 * DEALINGS IN THE SOFTWARE.                                                   *
 *******************************************************************************/

using System.Windows;
using System.Windows.Media;
using System.Windows.Controls;
using zeal.ui.util;

namespace zeal.ui.graph
{
	internal partial class BezierPath
	{
		public static readonly DependencyProperty<Point> SourceProperty = DependencyProperty.Register("Source", typeof(Point), typeof(BezierPath), new FrameworkPropertyMetadata(new Point(double.NaN, double.NaN), FrameworkPropertyMetadataOptions.AffectsRender, onRouteChangedInternal)).of<Point>();
		public Point Source { get { return (Point) this.GetValue(SourceProperty); } set { this.SetValue(SourceProperty, value); } }
		private static void onRouteChangedInternal(DependencyObject obj, DependencyPropertyChangedEventArgs args) { ((BezierPath) obj).onRouteChanged(); }
		
		public static readonly DependencyProperty<Point> DestinationProperty = DependencyProperty.Register("Destination", typeof(Point), typeof(BezierPath), new FrameworkPropertyMetadata(new Point(double.NaN, double.NaN), FrameworkPropertyMetadataOptions.AffectsRender, onRouteChangedInternal)).of<Point>();
		public Point Destination { get { return (Point) this.GetValue(DestinationProperty); } set { this.SetValue(DestinationProperty, value); } }
		
		public static readonly DependencyProperty<Pen> PenProperty = DependencyProperty.Register("Pen", typeof(Pen), typeof(BezierPath), new FrameworkPropertyMetadata(default(Pen), FrameworkPropertyMetadataOptions.AffectsRender)).of<Pen>();
		public Pen Pen { get { return (Pen) this.GetValue(PenProperty); } set { this.SetValue(PenProperty, value); } }
		
	}
	
	internal partial class GraphEdge
	{
		public static readonly DependencyProperty<bool> IsActiveProperty = DependencyProperty.Register("IsActive", typeof(bool), typeof(GraphEdge), new PropertyMetadata(default(bool))).of<bool>();
		public bool IsActive { get { return (bool) this.GetValue(IsActiveProperty); } private set { this.SetValue(IsActiveProperty, value); } }
		
	}
	
	internal partial class GraphNode
	{
		public static readonly DependencyProperty<bool> IsSelectedProperty = DependencyProperty.Register("IsSelected", typeof(bool), typeof(GraphNode), new PropertyMetadata(default(bool))).of<bool>();
		public bool IsSelected { get { return (bool) this.GetValue(IsSelectedProperty); } set { this.SetValue(IsSelectedProperty, value); } }
		
	}
	
	internal partial class GraphPort
	{
		public static readonly DependencyProperty<Point> AnchorPointProperty = DependencyProperty.Register("AnchorPoint", typeof(Point), typeof(GraphPort), new PropertyMetadata(default(Point))).of<Point>();
		public Point AnchorPoint { get { return (Point) this.GetValue(AnchorPointProperty); } private set { this.SetValue(AnchorPointProperty, value); } }
		
		private static readonly DependencyPropertyKey IsConnectedPropertyKey = DependencyProperty.RegisterReadOnly("IsConnected", typeof(bool), typeof(GraphPort), new PropertyMetadata(default(bool)));
		public static readonly DependencyProperty<bool> IsConnectedProperty = IsConnectedPropertyKey.DependencyProperty.of<bool>();
		public bool IsConnected { get { return (bool) this.GetValue(IsConnectedProperty); } private set { this.SetValue(IsConnectedPropertyKey, value); } }
		
		public static readonly DependencyProperty<bool> IsEdgeSelectedProperty = DependencyProperty.Register("IsEdgeSelected", typeof(bool), typeof(GraphPort), new PropertyMetadata(default(bool))).of<bool>();
		public bool IsEdgeSelected { get { return (bool) this.GetValue(IsEdgeSelectedProperty); } private set { this.SetValue(IsEdgeSelectedProperty, value); } }
		
		public static readonly DependencyProperty<ConnectionStates> ConnectionStateProperty = DependencyProperty.Register("ConnectionState", typeof(ConnectionStates), typeof(GraphPort), new PropertyMetadata(default(ConnectionStates))).of<ConnectionStates>();
		public ConnectionStates ConnectionState { get { return (ConnectionStates) this.GetValue(ConnectionStateProperty); } set { this.SetValue(ConnectionStateProperty, value); } }
		
		public static readonly DependencyProperty<Pen> PortBorderProperty = DependencyProperty.Register("PortBorder", typeof(Pen), typeof(GraphPort), new PropertyMetadata(default(Pen))).of<Pen>();
		public Pen PortBorder { get { return (Pen) this.GetValue(PortBorderProperty); } private set { this.SetValue(PortBorderProperty, value); } }
		
		public static readonly DependencyProperty<Brush> PortFillProperty = DependencyProperty.Register("PortFill", typeof(Brush), typeof(GraphPort), new PropertyMetadata(default(Brush))).of<Brush>();
		public Brush PortFill { get { return (Brush) this.GetValue(PortFillProperty); } private set { this.SetValue(PortFillProperty, value); } }
		
	}
	
	internal partial class GraphViewer
	{
		public static readonly DependencyProperty<double> OriginXProperty = DependencyProperty.Register("OriginX", typeof(double), typeof(GraphViewer), new PropertyMetadata(default(double))).of<double>();
		public double OriginX { get { return (double) this.GetValue(OriginXProperty); } set { this.SetValue(OriginXProperty, value); } }
		
		public static readonly DependencyProperty<double> OriginYProperty = DependencyProperty.Register("OriginY", typeof(double), typeof(GraphViewer), new PropertyMetadata(default(double))).of<double>();
		public double OriginY { get { return (double) this.GetValue(OriginYProperty); } set { this.SetValue(OriginYProperty, value); } }
		
		private static readonly DependencyProperty<Point> ToolTipPositionProperty = DependencyProperty.RegisterAttached("ToolTipPosition", typeof(Point), typeof(GraphViewer), new PropertyMetadata(default(Point))).of<Point>();
		private static Point GetToolTipPosition(DependencyObject obj) { return (Point) obj.GetValue(ToolTipPositionProperty); }
		private static void SetToolTipPosition(DependencyObject obj, Point value) { obj.SetValue(ToolTipPositionProperty, value); }
		
	}
	
}

namespace zeal.ui.util
{
	internal partial class MeasuringCanvas
	{
		private static readonly DependencyPropertyKey MinXPropertyKey = DependencyProperty.RegisterReadOnly("MinX", typeof(double), typeof(MeasuringCanvas), new PropertyMetadata(double.NaN));
		public static readonly DependencyProperty<double> MinXProperty = MinXPropertyKey.DependencyProperty.of<double>();
		public double MinX { get { return (double) this.GetValue(MinXProperty); } private set { this.SetValue(MinXPropertyKey, value); } }
		
		private static readonly DependencyPropertyKey MinYPropertyKey = DependencyProperty.RegisterReadOnly("MinY", typeof(double), typeof(MeasuringCanvas), new PropertyMetadata(double.NaN));
		public static readonly DependencyProperty<double> MinYProperty = MinYPropertyKey.DependencyProperty.of<double>();
		public double MinY { get { return (double) this.GetValue(MinYProperty); } private set { this.SetValue(MinYPropertyKey, value); } }
		
		private static readonly DependencyPropertyKey MaxXPropertyKey = DependencyProperty.RegisterReadOnly("MaxX", typeof(double), typeof(MeasuringCanvas), new PropertyMetadata(double.NaN));
		public static readonly DependencyProperty<double> MaxXProperty = MaxXPropertyKey.DependencyProperty.of<double>();
		public double MaxX { get { return (double) this.GetValue(MaxXProperty); } private set { this.SetValue(MaxXPropertyKey, value); } }
		
		private static readonly DependencyPropertyKey MaxYPropertyKey = DependencyProperty.RegisterReadOnly("MaxY", typeof(double), typeof(MeasuringCanvas), new PropertyMetadata(double.NaN));
		public static readonly DependencyProperty<double> MaxYProperty = MaxYPropertyKey.DependencyProperty.of<double>();
		public double MaxY { get { return (double) this.GetValue(MaxYProperty); } private set { this.SetValue(MaxYPropertyKey, value); } }
		
	}
	
	internal partial class AsyncProgressMonitor
	{
		private static readonly DependencyPropertyKey taskPropertyKey = DependencyProperty.RegisterReadOnly("task", typeof(string), typeof(AsyncProgressMonitor), new PropertyMetadata(string.Empty));
		public static readonly DependencyProperty<string> taskProperty = taskPropertyKey.DependencyProperty.of<string>();
		public string task { get { return (string) this.GetValue(taskProperty); } private set { this.SetValue(taskPropertyKey, value); } }
		
		private static readonly DependencyPropertyKey totalWorkPropertyKey = DependencyProperty.RegisterReadOnly("totalWork", typeof(int), typeof(AsyncProgressMonitor), new PropertyMetadata(-1));
		public static readonly DependencyProperty<int> totalWorkProperty = totalWorkPropertyKey.DependencyProperty.of<int>();
		public int totalWork { get { return (int) this.GetValue(totalWorkProperty); } private set { this.SetValue(totalWorkPropertyKey, value); } }
		
		private static readonly DependencyPropertyKey workCompletePropertyKey = DependencyProperty.RegisterReadOnly("workComplete", typeof(int), typeof(AsyncProgressMonitor), new PropertyMetadata(default(int)));
		public static readonly DependencyProperty<int> workCompleteProperty = workCompletePropertyKey.DependencyProperty.of<int>();
		public int workComplete { get { return (int) this.GetValue(workCompleteProperty); } private set { this.SetValue(workCompletePropertyKey, value); } }
		
		public static readonly DependencyProperty<int> workRemainingProperty = DependencyProperty.Register("workRemaining", typeof(int), typeof(AsyncProgressMonitor), new PropertyMetadata(default(int))).of<int>();
		public int workRemaining { get { return (int) this.GetValue(workRemainingProperty); } private set { this.SetValue(workRemainingProperty, value); } }
		
		public static readonly DependencyProperty<double> percentCompleteProperty = DependencyProperty.Register("percentComplete", typeof(double), typeof(AsyncProgressMonitor), new PropertyMetadata(default(double))).of<double>();
		public double percentComplete { get { return (double) this.GetValue(percentCompleteProperty); } private set { this.SetValue(percentCompleteProperty, value); } }
		
		public static readonly DependencyProperty<bool> startedProperty = DependencyProperty.Register("started", typeof(bool), typeof(AsyncProgressMonitor), new PropertyMetadata(default(bool))).of<bool>();
		public bool started { get { return (bool) this.GetValue(startedProperty); } private set { this.SetValue(startedProperty, value); } }
		
		public static readonly DependencyProperty<bool> completedProperty = DependencyProperty.Register("completed", typeof(bool), typeof(AsyncProgressMonitor), new PropertyMetadata(default(bool))).of<bool>();
		public bool completed { get { return (bool) this.GetValue(completedProperty); } private set { this.SetValue(completedProperty, value); } }
		
		private static readonly DependencyPropertyKey cancelledPropertyKey = DependencyProperty.RegisterReadOnly("cancelled", typeof(bool), typeof(AsyncProgressMonitor), new PropertyMetadata(default(bool)));
		public static readonly DependencyProperty<bool> cancelledProperty = cancelledPropertyKey.DependencyProperty.of<bool>();
		public bool cancelled { get { return (bool) this.GetValue(cancelledProperty); } private set { this.SetValue(cancelledPropertyKey, value); } }
		
	}
	
}

namespace zeal.ui
{
	internal partial class DocumentEditor
	{
		private static readonly DependencyPropertyKey HasUnsavedChangesPropertyKey = DependencyProperty.RegisterReadOnly("HasUnsavedChanges", typeof(bool), typeof(DocumentEditor), new PropertyMetadata(default(bool)));
		public static readonly DependencyProperty<bool> HasUnsavedChangesProperty = HasUnsavedChangesPropertyKey.DependencyProperty.of<bool>();
		public bool HasUnsavedChanges { get { return (bool) this.GetValue(HasUnsavedChangesProperty); } private set { this.SetValue(HasUnsavedChangesPropertyKey, value); } }
		
		public static readonly DependencyProperty<string> FilenameProperty = DependencyProperty.Register("Filename", typeof(string), typeof(DocumentEditor), new PropertyMetadata(default(string))).of<string>();
		public string Filename { get { return (string) this.GetValue(FilenameProperty); } set { this.SetValue(FilenameProperty, value); } }
		
	}
	
}

 
